package HomeWork;

import java.util.Arrays;

public class Test_2 {
    public static void main(String[] args) {
        int[] nums = {1,2,3,4,5,6,7};
        int k = 3;
        //7 - 3 = 4
        int cut = nums.length - k ;
        int[] a = Arrays.copyOfRange(nums,0,cut);
        int[] b = Arrays.copyOfRange(nums,cut,nums.length);
        int[] c = new int[nums.length];
        for (int i = 0; i < b.length; i++) {
            c[i] = b[i];
        }
        for (int i = b.length, j = 0; j < a.length; i++,j++) {
            c[i] = a[j];
        }
        nums = c;
        for (int x:nums) {
            System.out.print(x+" ");
        }
    }
}
